﻿using System;
using System.Text;
using System.Reflection;
using System.ServiceModel;
using System.Configuration;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using TDS = Tridion.ContentManager.Interop.TDS;
using COM = System.Runtime.InteropServices.ComTypes;
using TDSDefines = Tridion.ContentManager.Interop.TDSDefines;
using System.Xml;
using System.Data;
using System.Data.SqlClient;


namespace Tridion.Gateway
{
    [ServiceContract]
    public interface ITridionContext
    {
        [OperationContract]
        ListRowFilter CreateListRowFilter();

        [OperationContract]
        string ExecuteProc(string ProcedureName, Dictionary<string, string> Paramaters);
   
        [OperationContract]
        void FlushCache(string ObjectOrUri);

        [OperationContract]
        Component GetComponent(string ComponentId, string PublicationId, bool EditMode, int Version);

        [OperationContract]
        ComponentTemplate GetComponentTemplate(string ComponentTemplateId, string PublicationId, bool EditMode, int Version);

        [OperationContract]
        Schema[] GetDestinationProtocols();

        [OperationContract]
        string GetEnumerationValues(string enumerations);

        [OperationContract]
        Folder GetFolder(string FolderId, string PublicationId);

        [OperationContract]
        Item[] GetFolderItems(Folder Folder);

        [OperationContract]
        string GetFolderListItems(string PublicationId, string FolderId, Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter ColumnFilter, ListRowFilter[] RowFilters);

        [OperationContract]
        Group[] GetGroups();

        [OperationContract]
        string GetListApprovalStatuses(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter ColumnFilter);

        [OperationContract]
        string GetListDestinationProtocols(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter ColumnFilter);

        [OperationContract]
        string GetListDirectoryServices(ListRowFilter[] RowFilters);

        [OperationContract]
        string GetListDirectoryServiceTestUsers(string DirectoryService, string SearchDN, Tridion.ContentManager.Interop.TDSDefines.EnumDirectorySearchTypes SearchType);

        [OperationContract]
        string GetListItems(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter ColumnFilter, ListRowFilter[] RowFilters);

        [OperationContract]
        string GetListMultimediaTypes(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter ColumnFilter);

        [OperationContract]
        string GetListNonSystemUsers(Tridion.ContentManager.Interop.TDSDefines.EnumNonSystemUserType UserType, string NameOfDomainOrDirectory);

        [OperationContract]
        string GetListPublications(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter ColumnFilter);

        [OperationContract]
        string GetListPublicationTargets(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter ColumnFilter);

        [OperationContract]
        string GetListTargetTypes(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter ColumnFilter);

        [OperationContract]
        string GetListTemplateTypes(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter ColumnFilter, ListRowFilter[] RowFilters);

        [OperationContract]
        string GetListTrustees(Tridion.ContentManager.Interop.TDSDefines.TrusteeType TrusteeTypes, Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter ColumnFilter, ListRowFilter[] RowFilters);

        [OperationContract]
        string GetListVirtualFolderTypes(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter ColumnFilter);

        [OperationContract]
        string GetLocalizedErrorXML(string ErrorXML, int LangID);

        [OperationContract]
        MultimediaType[] GetMultimediaTypes();

        [OperationContract]
        string GetNewObject(Tridion.ContentManager.Interop.TDSDefines.ItemType ItemType, string PublicationId, string Folder, string Title, string Schema, string Xml);

        [OperationContract]
        string GetObject(string Uri, string PublicationId, Tridion.ContentManager.Interop.TDSDefines.XMLReadFilter Filter, bool ShallowCopy);

        [OperationContract]
        Page GetPage(string PageId, string PublicationId, bool EditMode, int Version);

        [OperationContract]
        PageTemplate GetPageTemplate(string PageTemplateId, string PublicationId, bool EditMode, int Version);

        [OperationContract]
        Publication GetPublication(string PublicationId);

        [OperationContract]
        Item[] GetPublicationItems(Publication Publication);

        [OperationContract]
        string GetPublicationListItems(string PublicationId, Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter ColumnFilter, ListRowFilter[] RowFilters);

        [OperationContract]
        Publication[] GetPublications();

        [OperationContract]
        PublicationTarget GetPublicationTarget(string PublicationTargetId);

        [OperationContract]
        PublicationTarget[] GetPublicationTargets();

        [OperationContract]
        PublishTransaction GetPublishTransaction(string PublishTransactionId);

        [OperationContract]
        StructureGroup GetStructureGroup(string StructureGroupId, string PublicationId);

        [OperationContract]
        Item[] GetStructureGroupItems(StructureGroup StructureGroup);

        [OperationContract]
        string GetStructureGroupListItems(string PublicationId, string StructureGroupId, Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter ColumnFilter, ListRowFilter[] RowFilters);
                
        [OperationContract]
        string GetSystemXSD(string NameOrNamespaceUri);
        
        [OperationContract]
        TargetType GetTargetType(string TargetTypeId);
        
        [OperationContract]
        TargetType[] GetTargetTypes();

        [OperationContract]
        User[] GetUsers();

        [OperationContract]
        string GetVersion();

        [OperationContract]
        Schema[] GetVirtualFolderTypes();

        [OperationContract]
        string GetXML(string Uri, Tridion.ContentManager.Interop.TDSDefines.XMLReadFilter Filter);
        
        [OperationContract]
        string[] GetXMLForEach(string[] URIs, Tridion.ContentManager.Interop.TDSDefines.XMLReadFilter filter);
    }
}
